#include<bits/stdc++.h>
#define int long long
#define x first
#define y second
using namespace std;
const int N = 1e5+5,M = 3005;
int n,m,K,top,f[N],w[M][M];
pair<int,int> a[N],b[N],tmp[N];
signed main()
{
	freopen("move.in","r",stdin);
	freopen("move.out","w",stdout);
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>n>>m>>K;
	for(int i = 1;i<=n;i++) cin>>tmp[i].x>>tmp[i].y;
	for(int i = 1;i<=m;i++) cin>>b[i].x>>b[i].y;
	sort(tmp+1,tmp+n+1);
	for(int i = 1;i<=n;i++)
	{
		while(top&&tmp[i].y>=a[top].y) top--;
		a[++top] = tmp[i];
	}
	n = top;
	a[n+1].x = 2e18;
//	cerr<<n<<'\n';
	sort(b+1,b+m+1);
	for(int i = 1;i<=n;i++)
	{
		int p = 1,now = 2e18;
		while(p<=m&&b[p].x<a[i-1].x) p++;
		for(int j = i;j<=n;j++)
		{
//			w[i][j] = 2e18;
//			for(int k = 1;k<=m;k++)
//				if(b[k].x>=a[i-1].x&&b[k].x<=a[j+1].x)
//				{
//					w[i][j] = min(w[i][j],max(0ll,a[j].x-b[k].x)+max(0ll,a[i].y-b[k].y));
//					if(max(0ll,a[j].x-b[k].x)+max(0ll,a[i].y-b[k].y)==0) cerr<<"xx"<<i<<' '<<j<<' '<<b[k].x<<' '<<b[k].y<<'\n';
//				}
			now+=a[j].x-a[j-1].x;
			while(p<=m&&b[p].x<=a[j].x)
			{
				now = min(now,max(0ll,a[j].x-b[p].x)+max(0ll,a[i].y-b[p].y));
				p++;
			}
			w[i][j] = now;
			for(int k = p;k<=m&&b[k].x<a[j+1].x;k++) w[i][j] = min(w[i][j],max(0ll,a[j].x-b[k].x)+max(0ll,a[i].y-b[k].y));
		}
	}
//	cerr<<"ok\n";
	for(int i = 1;i<=n;i++)
	{
		f[i] = 2e18; 
		for(int j = 1;j<=i;j++)
			f[i] = min(f[i],f[j-1]+w[j][i]);
	}
	cout<<f[n];
	return 0;
}

